let marbleRaceLevel3_4 = {
	name: 'Game 3 Level 4',
	id: '3_4',
	type: 'elimination',
	eliminated: 1,
	objects: [
		// Portals
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			toPortal: 'a',
			x: 180,
			y: 530,
			width: 200,
			height: 20
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@goal',
			toPortal: 'goal',
			isGoal: true,
			x: 340,
			y: 530,
			width: 120,
			height: 20
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			toPortal: 'a',
			x: 500,
			y: 530,
			width: 200,
			height: 20
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@a',
			portalID: 'a',
			x: 340,
			y: 80,
			radius: 5
		},

		// Goal portal
		{
			type: 'object',
			shape: 'circle',
			color: '@goal',
			portalID: 'goal',
			x: 700,
			y: 80,
			radius: 5
		},

		// Obstacles
		{
			type: 'object',
			shape: 'circle',
			color: '@secondary',
			x: 340,
			y: 200,
			radius: 50,
			onBeforeUpdate: function (object, engine) {
				engine.setPosition(object.body, [340 + 240 * Math.sin(5 * engine.time), 200])
			}
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@secondary',
			x: 340,
			y: 400,
			radius: 50,
			onBeforeUpdate: function (object, engine) {
				engine.setPosition(object.body, [340 - 240 * Math.sin(5 * engine.time), 400])
			}
		},

		// Borders
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 0,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 600,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 0,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 800,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 640,
			y: 300,
			width: 80,
			height: 600
		},

		// Marbles
		{
			type: 'marbles',
			x: 340,
			y: 80,
			launchTime: 3,
			launchRadius: 75,
			passX: 700,
			passY: 80,
			radius: 8,
			eliminatedRadius: 6,
			velocity: 5
		},
	]
}
{
	let cntI = 15
	for (let i = 0; i <= cntI; ++i) {
		marbleRaceLevel3_4.objects.push({
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 340 + (i - cntI * .5) * 40,
			y: 400,
			width: 20,
			height: 400
		})
	}
}
marbleRaceLevels.push(marbleRaceLevel3_4)